// const express = require("express");
// const app = express();

// app.get("/", (req, res) => {
//   res.send("欢迎来到王者荣耀英雄大全");
// });

// app.get("/hero", async (req, res) => {
//   const { default: fetch } = await import("node-fetch");
//   const result = await fetch("http://pvp.qq.com/web201605/js/herolist.json").then(resp => resp.json());
//   res.send(result);
// });

// app.listen(3001, () => {
//   console.log("server is running at http://localhost:3001");
// });

import("node-fetch").then(({ default: fetch }) => {
  fetch("http://pvp.qq.com/web201605/js/herolist.json")
    .then(resp => resp.json())
    .then(data => console.log(data));
});
